const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

const port = process.env.port || process.env.npm_config_port || 8081 // dev port

module.exports = {
  publicPath: "", //dev ./   prod /
  outputDir: "dist",
  assetsDir: "static",
  lintOnSave: false, //process.env.NODE_ENV === 'development',
  productionSourceMap: false,
  devServer: {
    port: port,
    open: true,
    overlay: {
      warnings: false,
      errors: true,
    },
    proxy: {
      "/api": {
        target: "http://abc.com", // 后台接口域名
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  configureWebpack: {
    name: "超大屏项目适配方案",
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
  },
  css: {
    //全局配置utils.scss
    loaderOptions: {
      sass: {
        prependData: `@import "@/assets/styles/computed.scss";`,
      },
    },
  },
};
